import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
export function uploadAvatar(data) {
  return request({
    url: '/user/avatar',
    method: 'post',
    data
  })
}
// export async function getInfo(id) {
//   const url = `/user/${id}`
//   return request({
//     url,
//     method: 'get'
//   })
// }
export function getInfo(id) {
  const url = `/user/${id}`
  return request({
    url,
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}

// 查询部门下拉树结构
export function deptTreeSelect() {
  return request({
    url: '/user/deptTree',
    method: 'get'
  })
}
